# Makefile for OllamaChat C++

CXX = g++
CXXFLAGS = -std=c++11 -Wall -Wextra
LIBS = -lcurl -ljsoncpp
TARGET = ollama_chat
SOURCE = ollama_chat.cpp

# Default target
all: $(TARGET)

# Build the executable
$(TARGET): $(SOURCE)
	$(CXX) $(CXXFLAGS) -o $(TARGET) $(SOURCE) $(LIBS)

# Clean build artifacts
clean:
	rm -f $(TARGET)

# Install dependencies (Ubuntu/Debian)
install-deps:
	sudo apt-get update
	sudo apt-get install -y libcurl4-openssl-dev libjsoncpp-dev build-essential cmake

# Run the program
run: $(TARGET)
	./$(TARGET)

.PHONY: all clean install-deps run